[LOOP]-227 Capture pump component changes#536
Merged
Conversation
Camji55
requested changes
Aug 18, 2023
| case .tempBasal: | ||
| self = .tempBasal | ||
| case .alarm, .alarmClear, .prime, .rewind: | ||
| case .alarm, .alarmClear, .prime, .rewind, .replaceComponent(.reservoir), .replaceComponent(.pump), .replaceComponent(.infusionSet): |
Member
There was a problem hiding this comment.
Suggested change
| case .alarm, .alarmClear, .prime, .rewind, .replaceComponent(.reservoir), .replaceComponent(.pump), .replaceComponent(.infusionSet): | |
| case .alarm, .alarmClear, .prime, .rewind, .replaceComponent: |
|
|
||
|
|
||
| public struct NewPumpEvent: Equatable { | ||
| public static func == (lhs: NewPumpEvent, rhs: NewPumpEvent) -> Bool { |
Member
There was a problem hiding this comment.
This isn't quite a complete equality check. Making all the subtypes Equatable should give you this automatically. Happy to help if you need!
| return [.alarm, .alarmClear, .basal, .bolus, .prime, .resume, .rewind, .suspend, .tempBasal, .replaceComponent(componentType: .reservoir), .replaceComponent(componentType: .pump), .replaceComponent(componentType: .infusionSet)] | ||
| } | ||
|
|
||
| public static func == (lhs: PumpEventType, rhs: PumpEventType) -> Bool { |
Member
There was a problem hiding this comment.
Making ReplacementComponent Equatable should give you this automatically.
| case .basal: | ||
| return 9 | ||
| case .replaceComponent(componentType: .reservoir): | ||
| return 4 |
Member
There was a problem hiding this comment.
This can cause identity conflicts if all of these types have the same ID of 4. I'd make sure these are unique.
Author
There was a problem hiding this comment.
Agree, per offline discussion will set these to 10, 11, 12 as placeholders until there is further clarification on the order.
Camji55
approved these changes
Aug 18, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://tidepool.atlassian.net/browse/LOOP-227